/**
 *
 */
package net.jadoth.collections;

import java.util.List;

import net.jadoth.collections.VarMap.ThrowRemoveFirstEntry;
import net.jadoth.util.KeyValue;

/**
 * @author Thomas Muenz
 *
 */
public interface MapEntry<K, V> extends KeyValue<K, V>
{
	// set doesn't need to signal to remove the first element, get is enough
	public Object set(int hash, K key, V value);

	/**
	 * Throws a {@link ThrowRemoveFirstEntry} signal throw if this entry is the first in the bucket but has become
	 * hollow
	 *
	 * @param hash
	 * @param key
	 * @return
	 * @throws ThrowRemoveFirstEntry
	 */
	public Object get(int hash, K key) throws ThrowRemoveFirstEntry;

	// remove doesn't need to signal to remove the first element as it does so by regular means anyway
	public MapEntry<K, V> remove(int hash, Object key);

	public MapEntry<K, V> next();

	public V value();

	public boolean has(int hash, K key) throws ThrowRemoveFirstEntry;
	public boolean has(Object value) throws ThrowRemoveFirstEntry;

	public int addValues(final List<Object> valuesList);
	
	public int getHash();
	
	public void setNext(MapEntry<K, V> entry);


	public boolean isHollow();
}
